package com.workerhelping.feignClients;

import com.workerhelping.elasticsearchEntity.ESAssistVO;
import com.workerhelping.elasticsearchEntity.ESRecordVO;
import com.workerhelping.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("ELASTICSEARCH")
public interface ESFeignClient {
    @PostMapping("/ESRecord/insertOrUpdate")
    Result<String> insertOrUpdate(@RequestBody ESRecordVO esRecordVO);

    @GetMapping("/ESAssist/search")
    Result<List<ESAssistVO>> searchAssist(@RequestParam(value = "startDate", required = false) String startDate,
                                          @RequestParam(value = "endDate", required = false) String endDate,
                                          @RequestParam(value = "minPrice", required = false) Double minPrice,
                                          @RequestParam(value = "maxPrice", required = false) Double maxPrice,
                                          @RequestParam(value = "sCategory", required = false) String category,
                                          @RequestParam(value = "workerId", required = false) Integer workerId);
}
